Skip to content

fix: preserve null values in Validation::getValidated()#10101

Open
michalsn wants to merge 1 commit intocodeigniter4:developfrom
michalsn:fix/dot-array-filter
Open

fix: preserve null values in Validation::getValidated()#10101
michalsn wants to merge 1 commit intocodeigniter4:developfrom
michalsn:fix/dot-array-filter

Conversation

@michalsn
Copy link
Copy Markdown
Member

Description
This PR fixes a validation bug where Validation::getValidated() could drop fields whose validated value was explicitly null.

The issue came from DotArrayFilter, which treated null like a missing key when building the validated data array. With this change, explicit null values are preserved, so validated output stays consistent with the original validated input, including cases such as permit_empty.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope that no one disrupts their work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants